/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseBusinessCardEntity.cs
*        创建系统时间:       2012/11/2 19:07:02
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseBusinessCardEntity
    {
        private string address;
        private string bankAccount;
        private string bankName;
        private string company;
        private string createDate;
        private string createUserID;
        private string description;
        private string email;
        private string fax;
        private string fullName;
        private string id;
        private string mobile;
        private string modifyDate;
        private string modifyUserID;
        private string officePhone;
        private bool personal;
        private string phone;
        private string postalcode;
        private string qQ;
        private string sortCode;
        private string taxAccount;
        private string title;
        private string web;

        public BaseBusinessCardEntity()
        {
        }

        public BaseBusinessCardEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        public BaseBusinessCardEntity(DataTable dataTable)
        {
            this.GetFrom(dataTable);
        }

        public BaseBusinessCardEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldID]);
            this.FullName = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldFullName]);
            this.Title = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldTitle]);
            this.Company = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldCompany]);
            this.Phone = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldPhone]);
            this.Postalcode = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldPostalcode]);
            this.Mobile = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldMobile]);
            this.Address = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldAddress]);
            this.Email = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldEmail]);
            this.OfficePhone = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldOfficePhone]);
            this.QQ = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldQQ]);
            this.Fax = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldFax]);
            this.Web = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldWeb]);
            this.BankName = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldBankName]);
            this.BankAccount = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldBankAccount]);
            this.TaxAccount = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldTaxAccount]);
            this.Personal = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseBusinessCardTable.FieldPersonal]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldDescription]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldSortCode]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldCreateUserID]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldCreateDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldModifyUserID]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseBusinessCardTable.FieldModifyDate]);
            return this;
        }

        public BaseBusinessCardEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string Address
        {
            get
            {
                return this.address;
            }
            set
            {
                this.address = value;
            }
        }

        public string BankAccount
        {
            get
            {
                return this.bankAccount;
            }
            set
            {
                this.bankAccount = value;
            }
        }

        public string BankName
        {
            get
            {
                return this.bankName;
            }
            set
            {
                this.bankName = value;
            }
        }

        public string Company
        {
            get
            {
                return this.company;
            }
            set
            {
                this.company = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public string Email
        {
            get
            {
                return this.email;
            }
            set
            {
                this.email = value;
            }
        }

        public string Fax
        {
            get
            {
                return this.fax;
            }
            set
            {
                this.fax = value;
            }
        }

        public string FullName
        {
            get
            {
                return this.fullName;
            }
            set
            {
                this.fullName = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public string Mobile
        {
            get
            {
                return this.mobile;
            }
            set
            {
                this.mobile = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string OfficePhone
        {
            get
            {
                return this.officePhone;
            }
            set
            {
                this.officePhone = value;
            }
        }

        public bool Personal
        {
            get
            {
                return this.personal;
            }
            set
            {
                this.personal = value;
            }
        }

        public string Phone
        {
            get
            {
                return this.phone;
            }
            set
            {
                this.phone = value;
            }
        }

        public string Postalcode
        {
            get
            {
                return this.postalcode;
            }
            set
            {
                this.postalcode = value;
            }
        }

        public string QQ
        {
            get
            {
                return this.qQ;
            }
            set
            {
                this.qQ = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string TaxAccount
        {
            get
            {
                return this.taxAccount;
            }
            set
            {
                this.taxAccount = value;
            }
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }

        public string Web
        {
            get
            {
                return this.web;
            }
            set
            {
                this.web = value;
            }
        }
    }
}